package algorithms.timewheel;

/**
 * @description:
 * @author: zk
 * @date: 2023-04-14 17:01
 */
public class TimeWheelTest {
    public static void main(String[] args) {
        TimeWheelSimple wheelSimple = TimeWheelSimple.INSTANCE;
        wheelSimple.start();
        /*
        TimeWheelSimple.Handler handler50 = new TimeWheelSimple.Handler();
        handler50.setTime(50L);// 50后执行
        handler50.setName("50后执行");
        wheelSimple.addHandler(handler50);
        */
        TimeWheelSimple.Handler handler10 = new TimeWheelSimple.Handler();
        handler10.setTime(10L);// 10后执行
        handler10.setName("10s后执行哦---大笨蛋！");
        handler10.setOnce(false);
        wheelSimple.addHandler(handler10, handler10.getTime());
        /*
        TimeWheelSimple.Handler handler55 = new TimeWheelSimple.Handler();
        handler55.setTime(55L);// 55后执行
        handler55.setName("55后执行");
        wheelSimple.addHandler(handler55);

        TimeWheelSimple.Handler handler30 = new TimeWheelSimple.Handler();
        handler30.setTime(30L);// 30后执行
        handler30.setName("30后执行");
        wheelSimple.addHandler(handler30);

        TimeWheelSimple.Handler handler302 = new TimeWheelSimple.Handler();
        handler302.setTime(30L);// 30后执行
        handler302.setName("30后执行-第二个任务");
        wheelSimple.addHandler(handler302);
         */
    }


}
